select distinct r.uk_code, pc.zppcg151,r.lib_rubrique,'P.0.'||substr(pc.zppcg151,1,3), pc.code_param_code
from fi_gen_plan_comptable pc, fi_ana_rubrique r
where 1 = 1 
 and pc.zppcg151 = r.uk_code
 and pc.code_param_code='CSCIV' -- '<§code_parametrage>' 
 and zppcg151 is not null;
 
 select * from fi_gen_plan_comptable where code_param_code='CSCIV' and zppcg151 is not null;
 select uk_code, libelle_unite_gestion from fi_par_unite_gestion;
 select * from fi_par_unite_comptable_gestion;
 select * from fi_par_unite_gestion_plan pla inner join fi_gen_plan_comptable pc on pla.unite_gestion_uk_code = pc.code_param_code where pla.unite_gestion_uk_code in ('GM','SCI');
 select distinct code_param_code from fi_gen_plan_comptable;
 select * from fi_par_unite_comptable_gestion gest inner join fi_par_unite_comptable compt on gest.unite_comptable_id = compt.id;
 select * from fi_par_unite_gestion;
 select * from fi_par_unite_comptable;
 select
  CREATION_DATE,
  CREATED_BY,
  LAST_MODIFIED_DATE,
  LAST_MODIFIED_BY,
  LIBELLE_PLAN_PARAMETRAGE,
  ETAT,
  CODE_PAR_DEFAUT_CODE
FROM FI_PAR_PLAN_PARAMETRAGE ;
fi_;
SELECT UK_CODE,
    LIBELLE_UNITE_GESTION
FROM FI_PAR_UNITE_GESTION ;
